package club.justwill.single.persistence.document;

import org.springframework.data.mongodb.core.index.IndexDirection;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;

/**
 * Created by xiangnan on 16-1-14.
 */
@Document(collection = "mobile_authcodes")
public class MobileAuthCode extends MongoDocument {
    @Field("mobile")
    @Indexed(name = "mobile_authcodes_mobile")
    private String mobile;

    @Field("authcode")
    private int authcode;

    @Field("expiry")
    @Indexed(name = "mobile_authcodes_expiry", direction = IndexDirection.ASCENDING)
    private Date expiry;

    //generated getters and setters

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public int getAuthcode() {
        return authcode;
    }

    public void setAuthcode(int authcode) {
        this.authcode = authcode;
    }

    public Date getExpiry() {
        return expiry;
    }

    public void setExpiry(Date expiry) {
        this.expiry = expiry;
    }
}
